import log from '@dfeidao/atom-nodejs/logger/log';
import { IncomingHttpHeaders } from 'http';
import doc_code from '@dfeidao/atom-nodejs/msg/doc-code';
import operate from '@dfeidao/atom-nodejs/db/operate';
import { systemid,productid} from '../../atom/config';

interface Message {
filter:{
	productid:string,
	project_no:string,
	work_bill_no:string,
	assetsname:string,
	place:string,
	working_hours:string,
	cust_name:string,
	contact_number:string,
	source_type:string,
	job_content:string,
	dyremindtime:string,
	create_time:string,
	work_order_status:string
}
}

export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders){
	const { exec, insert, update, del } = operate(action_id,session_id,systemid);
	// 插入数据
	insert('work_order',message.filter);
	
	const res = await exec();
	return res;
}
